// Learn TypeScript:
//  - https://docs.cocos.com/creator/2.4/manual/en/scripting/typescript.html
// Learn Attribute:
//  - https://docs.cocos.com/creator/2.4/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
//  - https://docs.cocos.com/creator/2.4/manual/en/scripting/life-cycle-callbacks.html

const { ccclass, property } = cc._decorator;

@ccclass
export default class Privacy extends cc.Component {

    Yes() {
        localStorage.setItem("Hide", "1");
        this.node.active = false;
    }

    No() {
        //@ts-ignore
        qg.exitApplication({
            success: function () {
                console.log("exitApplication success");
            },
            fail: function () {
                console.log("exitApplication fail");
            },
            complete: function () {
                console.log("exitApplication complete");
            }
        });
    }

    Close() {
        this.node.active = false;
    }

    Open() {
        this.node.active = true;
    }
}
